import React from "react";
import { Navigate } from "react-router-dom";

// eslint-disable-next-line no-unused-vars
function Hoc_Login(Com) {
  return ()=>{
    let token = localStorage.getItem("token");
    if (token) {
      return <Com />;
    } else {
      return <Navigate to="/login"></Navigate>;
    }
  };
}

export default Hoc_Login;
